<!--{include(pe_tpl('header.html'));}-->
<div class="right_page">
	<div class="now">
		<!--{foreach($ini['ad_client'] as $k=>$v):}-->
		<a href="admin.php?mod=ad&client={$k}" <!--{if($_g_client==$k):}-->class="sel"<!--{endif;}-->>{$v['name']}（{$tongji[$k]}）<i></i></a>
		<!--{endforeach;}-->
		<a href="admin.php?mod=ad&act=add&client={$_g_client}" id="fabu">添加广告</a>
		<div class="clear"></div>
	</div>
	<div class="right_main">
		<form method="post" id="form">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
		<tr>
			<th class="bgtt" width="20"><input type="checkbox" name="checkall" onclick="pe_checkall(this, 'ad_id')" /></th>
			<th class="bgtt" width="50">ID号</th>
			<th class="bgtt" width="50">排序</th>
			<th class="bgtt" width="200">广告图片</th>
			<th class="bgtt" width="200">广告位置</th>
			<th class="bgtt">链接地址</th>
			<th class="bgtt" width="100">开启状态</th>
			<th class="bgtt" width="100">操作</th>
		</tr>
		<!--{foreach($info_list as $v):}-->
		<tr height="60">
			<td><input type="checkbox" name="ad_id[]" value="{$v['ad_id']}" /></td>
			<td>{$v['ad_id']}</td>
			<td><input type="text" name="ad_order[{$v['ad_id']}]" value="{$v['ad_order']}" class="inputtext input30 center" /></td>
			<td><img src="{pe_thumb($v['ad_logo'])}" style="width:150px; height:60px; border:1px solid #F2F2F2" /></td>
			<td>{$ini['ad_client'][$v['ad_client']]['list'][$v['ad_position']]['name']}<p>{$cache_category[$v['category_id']]['category_name']}</p></td>
			<td class="left"><a href="{$v['ad_url']}" target="_blank">{$v['ad_url']}</a></td>
			<td class="layui-form">
				<input type="checkbox" <!--{if($v['ad_state']):}-->checked<!--{endif;}--> lay-skin="switch" lay-text="开启|关闭" url="admin.php?mod=ad&act=state&id={$v['ad_id']}&token={$pe_token}" />
			</td>
			<td>
				<a href="admin.php?mod=ad&act=edit&id={$v['ad_id']}&{pe_jump()}" class="admin_edit mar3">修改</a>
				<a href="javascript:pe_confirm('删除', 'admin.php?mod=ad&act=del&id={$v['ad_id']}&token={$pe_token}')" class="admin_del">删除</a>
			</td>
		</tr>
		<!--{endforeach;}-->
		</table>
		</form>
	</div>
	<div class="right_bottom">
		<span class="fl">
			<input type="checkbox" name="checkall" onclick="pe_checkall(this, 'ad_id')" />
			<input type="button" onclick="pe_checksel('ad_id') && pe_confirm('批量删除', 'admin.php?mod=ad&act=del&token={$pe_token}', true)" value="批量删除" />
			<input type="button" onclick="pe_confirm('更新排序', 'admin.php?mod=ad&act=order&token={$pe_token}', true)" value="更新排序" />
		</span>
		<span class="fr fenye">{$db->page->html}</span>
		<div class="clear"></div>
	</div>
</div>
<link rel="stylesheet" href="{$pe['host']}include/plugin/layui/css/layui.css">
<script src="{$pe['host']}include/plugin/layui/layui.js"></script>
<script type="text/javascript">
layui.use(['form'], function(){
	form = layui.form;
	form.on('switch', function(data){
		var url = $(this).attr("url") + "&value=" + (this.checked ? 1 : 0)
		pe_get(url);
	});
});
</script>
<!--{include(pe_tpl('footer.html'));}-->